//||=========================================================================||
//||                                                                         ||
//||                             FastComplex.h                               ||
//||                                                                         ||
//||                           by the_best_goose))                           ||
//||                                                                         ||
//||=========================================================================||

#ifndef FASTCOMPLEX_H_
#define FASTCOMPLEX_H_

//-----------------------------------------------------------------------------

#define my_inline inline __attribute__((always_inline))

//-----------------------------------------------------------------------------

struct FastComplex
{
    my_inline FastComplex();
    my_inline FastComplex(const float re, const float im);
    my_inline FastComplex(const float re);
    my_inline void Null();
    my_inline const FastComplex& operator=(const FastComplex& c);
    my_inline FastComplex operator+(const FastComplex& c);
    my_inline FastComplex operator-(const FastComplex& c);
    my_inline FastComplex operator*(const FastComplex& c);
    my_inline FastComplex operator*(const float& c);
    my_inline FastComplex operator/(const FastComplex& c);
    friend my_inline FastComplex operator*(const float& d,
    		                               const FastComplex& c);
    friend my_inline FastComplex operator+(const float& d,
    		                               const FastComplex& c);
    friend my_inline FastComplex operator-(const float& d,
    		                               const FastComplex& c);

    float re, im;
};

//-----------------------------------------------------------------------------

my_inline FastComplex operator*(const float& d, const FastComplex& c);
my_inline FastComplex operator+(const float& d, const FastComplex& c);
my_inline FastComplex operator-(const float& d, const FastComplex& c);

my_inline FastComplex pow(const FastComplex& c, const int num);


//-----------------------------------------------------------------------------

#endif // FASTCOMPLEX_H_
